﻿'
' Created by SharpDevelop.
' User: ASV93
' Date: 12/08/2012
' Time: 16:46
' 
' To change this template use Tools | Options | Coding | Edit Standard Headers.
'
Public Partial Class MainForm
	Public Sub New()
		' The Me.InitializeComponent call is required for Windows Forms designer support.
		Me.InitializeComponent()
		
		'
		' TODO : Add constructor code after InitializeComponents
		'
	End Sub
	
	Sub TextBox1DragDrop(sender As Object, e As DragEventArgs)
		'Dim getthefuckout As String
		'getthefuckout = e.Data.GetData(DataFormats.FileDrop)
		'TextBox1.Text = getthefuckout
		'Messagebox.show(e.Data.GetData(DataFormats.FileDrop))
		If e.Data.GetDataPresent(DataFormats.FileDrop) Then
        Dim MyFiles() As String
        Dim i As Integer

        ' Assign the files to an array.
        MyFiles = e.Data.GetData(DataFormats.FileDrop)
        ' Loop through the array and add the files to the list.
        For i = 0 To MyFiles.Length - 1
            textBox1.Text = (MyFiles(i))
        Next
        End If
	End Sub
	
	Sub MainFormLoad(sender As Object, e As EventArgs)
		textBox1.AllowDrop = True		
	End Sub
	
	Sub TextBox1DragEnter(sender As Object, e As DragEventArgs)
		If e.Data.GetDataPresent(DataFormats.FileDrop) Then
			e.Effect = DragDropEffects.All
				'	Messagebox.show(e.Data.GetData(DataFormats.FileDrop))

		End If
		'		Messagebox.show(e.Data.GetData(DataFormats.FileDrop))

	End Sub
	
	Sub ListBox1DragEnter(sender As Object, e As DragEventArgs)
		If e.Data.GetDataPresent(DataFormats.FileDrop) Then
			e.Effect = DragDropEffects.All
				'	Messagebox.show(e.Data.GetData(DataFormats.FileDrop))

		End If
		
	End Sub
	
	Sub ListBox1DragDrop(sender As Object, e As DragEventArgs)
	    If e.Data.GetDataPresent(DataFormats.FileDrop) Then
        Dim MyFiles() As String
        Dim i As Integer

        ' Assign the files to an array.
        MyFiles = e.Data.GetData(DataFormats.FileDrop)
        ' Loop through the array and add the files to the list.
        For i = 0 To MyFiles.Length - 1
            ListBox1.Items.Add(MyFiles(i))
        Next
        End If
	End Sub
End Class
